﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __BC4D8426_D87A_4E33_A111_775D48535D00__
#define __BC4D8426_D87A_4E33_A111_775D48535D00__

namespace xos_http
{
    const char * i_compose_request_id = "B582CD27_970D_43BB_9652_CADC0BED1DFD";
    const char * i_compose_request_name = "i_compose_request";

    const char * i_compose_return_id = "89D8795E_618E_460F_80E9_57AA780FFCDB";
    const char * i_compose_return_name = "i_compose_return";

    const char * i_parse_request_id = "35071764_6C51_4D0D_9556_2F579E5CAA60";
    const char * i_parse_request_name = "i_parse_request";

    const char * i_parse_return_id = "2D748911_0273_4102_9427_2F65F4E328AF";
    const char * i_parse_return_name = "i_parse_return";

    const char * cls_module_id = "BC4D8426_D87A_4E33_A111_775D48535D00";
    const char * cls_module_name = "xos_http";

    const char * i_http_mgr_id = "83901984_3739_465A_A77A_416C58F1A134";
    const char * i_http_mgr_name = "i_http_mgr";

    // 
    // http ret cod define
    // 
    const char * HTTP_RET_CODE_100 = "100 Continue";
    const char * HTTP_RET_CODE_101 = "101 Switching Protocol";
    const char * HTTP_RET_CODE_103 = "103 Early Hints";

    const char * HTTP_RET_CODE_200 = "200 OK";
    const char * HTTP_RET_CODE_201 = "201 Created";
    const char * HTTP_RET_CODE_202 = "202 Accepted";
    const char * HTTP_RET_CODE_203 = "203 Non-Authoritative Information";
    const char * HTTP_RET_CODE_204 = "204 No Content";
    const char * HTTP_RET_CODE_205 = "205 Reset Content";
    const char * HTTP_RET_CODE_206 = "206 Partial Content";

    const char * HTTP_RET_CODE_300 = "300 Multiple Choices";
    const char * HTTP_RET_CODE_301 = "301 Moved Permanently";
    const char * HTTP_RET_CODE_302 = "302 Found";
    const char * HTTP_RET_CODE_303 = "303 See Other";
    const char * HTTP_RET_CODE_304 = "304 Not Modified";
    const char * HTTP_RET_CODE_307 = "307 Temporary Redirect";
    const char * HTTP_RET_CODE_308 = "308 Permanent Redirect";

    const char * HTTP_RET_CODE_400 = "400 Bad Request";
    const char * HTTP_RET_CODE_401 = "401 Unauthorized";
    const char * HTTP_RET_CODE_402 = "402 Payment Required";
    const char * HTTP_RET_CODE_403 = "403 Forbidden";
    const char * HTTP_RET_CODE_404 = "404 Not Found";
    const char * HTTP_RET_CODE_405 = "405 Method Not Allowed";
    const char * HTTP_RET_CODE_406 = "406 Not Acceptable";
    const char * HTTP_RET_CODE_407 = "407 Proxy Authentication Required";
    const char * HTTP_RET_CODE_408 = "408 Request Timeout";
    const char * HTTP_RET_CODE_409 = "409 Conflict";
    const char * HTTP_RET_CODE_410 = "410 Gone";
    const char * HTTP_RET_CODE_411 = "411 Length Required";
    const char * HTTP_RET_CODE_412 = "412 Precondition Failed";
    const char * HTTP_RET_CODE_413 = "413 Payload Too Large";
    const char * HTTP_RET_CODE_414 = "414 URI Too Long";
    const char * HTTP_RET_CODE_415 = "415 Unsupported Media Type";
    const char * HTTP_RET_CODE_416 = "416 Range Not Satisfiable";
    const char * HTTP_RET_CODE_417 = "417 Expectation Failed";
    const char * HTTP_RET_CODE_418 = "418 I'm a teapot";
    const char * HTTP_RET_CODE_422 = "422 Unprocessable Entity";
    const char * HTTP_RET_CODE_425 = "425 Too Early";
    const char * HTTP_RET_CODE_426 = "426 Upgrade Required";
    const char * HTTP_RET_CODE_428 = "428 Precondition Required";
    const char * HTTP_RET_CODE_429 = "429 Too Many Requests";
    const char * HTTP_RET_CODE_431 = "431 Request Header Fields Too Large";
    const char * HTTP_RET_CODE_451 = "451 Unavailable For Legal Reasons";

    const char * HTTP_RET_CODE_500 = "500 Internal Error";
    const char * HTTP_RET_CODE_501 = "501 Not Implemented";
    const char * HTTP_RET_CODE_502 = "502 Bad Gateway";
    const char * HTTP_RET_CODE_503 = "503 Service Unavailable";
    const char * HTTP_RET_CODE_504 = "504 Gateway Timeout";
    const char * HTTP_RET_CODE_505 = "505 HTTP Version Not Supported";
    const char * HTTP_RET_CODE_511 = "511 Network Authentication Required";

    // 
    // use tags
    // 
    const char * HTTP_CONTENT_ENCODING = "Content-Encoding";
    const char * HTTP_ACCEPT_ENCODING = "Accept-Encoding";
    const char * HTTP_ZIP_DEFLATE = "deflate";
    const char * HTTP_ZIP_GZIP = "gzip";

    // 
    // http request head tags
    // 
    const char * HTTP_REQUEST_CMD = "http_cmd";
    const char * HTTP_BODY = "http_body";
    const char * HTTP_REQUEST_RET_CODE = "http_ret_code";
    const char * HTTP_REQUEST_RET_DESC = "http_ret_desc";
    const char * HTTP_REQUEST_VER = "http_ver";
    const char * HTTP_REQUEST_URL = "http_url";
    const char * HTTP_REQUEST_URI = "http_uri";
    const char * HTTP_REQUEST_PARAM = "http_param";

    // 
    // http tags
    // 
    const char * HTTP_LOCATION = "Location";
    const char * HTTP_SERVER = "Server";
    const char * HTTP_ACCEPT = "Accept";
    const char * HTTP_ACCEPT_LANGUAGE = "Accept-Language";
    const char * HTTP_ACCEPT_RANGES = "Accept-Ranges";
    const char * HTTP_USER_AGENT = "User-Agent";
    const char * HTTP_HOST = "Host";
    const char * HTTP_PORT = "Port";
    const char * HTTP_CONTENT_LENGTH = "Content-Length";
    const char * HTTP_CONTENT_RANGE = "Content-Range";
    const char * HTTP_CONTENT_TYPE = "Content-Type";
    const char * HTTP_CONNECTION = "Connection";
    const char * HTTP_RANGE = "Range";
    const char * HTTP_DATE = "Date";

    // 
    // session and cookie
    // 
    const char * HTTP_SESSION_ID = "JSESSIONID";
    const char * HTTP_SET_COOKIE = "Set-Cookie";
    const char * HTTP_COOKIE = "Cookie";

    // 
    // multipart/form-data ---- application/x-www-form-urlencoded
    // 
    const char * POST_TYPE_APPLICATION = "application/x-www-form-urlencoded";
    const char * POST_TYPE_MULTIPART = "multipart/form-data";

    const char * HTTP_CONTENT_DISPOSITION = "Content-Disposition";
    const char * POST_MULTI_BOUNDARY = "boundary=";

    const char * POST_MULTI_DISP_TYPE_FORM = "form-data";
    const char * POST_MULTI_DISP_FORM_NAME = "name=";
    const char * POST_MULTI_DISP_FILE_NAME = "filename=";

    const char * MULTIPART_BODY_VALUE = "multipart_body_value";
    const char * MULTIPART_BODY_FILE = "multipart_body_file";
    const char * MULTIPART_BODY_LIST = "multipart_body_list";

    const char * MULTIPART_BODY_KEY = "multipart_body_key";
    //
    // 最大名字和值长度，超出直接失败，防止有人搞事
    //
    const int MAX_VALUE_LENGTH = 512;
    const int MAX_KEY_LENGTH = 256;
    const int MAX_URI_LENGTH = 4096;

}

#endif // __BC4D8426_D87A_4E33_A111_775D48535D00__

